package com.stu.shiro.service;

import com.stu.shiro.bean.SysUser;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

/**
 * @author MI
 * @ClassName ISysUserService.java
 * @createTime 2021年08月25日 15:33:00
 */
@Service
public class ISysUserService {
    private final Map<Integer, SysUser> map = new HashMap<>();

    @PostConstruct
    public void init() {
        map.put(1, new SysUser(1, "admin", "123"));
        map.put(2, new SysUser(2, "guest", "123"));
    }

    public SysUser getById(Integer userId) {
        return map.get(userId);
    }
}
